package com.itheima.demo03;

import java.util.ArrayList;

public class StudentUtil {
    //学生工具类
    private StudentUtil(){

    }

    //求最大值
    public static int getMaxAge(ArrayList<Student> list){
        int max = list.get(0).getAge();
        for (int i = 1; i < list.size(); i++) {
            Student student = list.get(i);
            int temAge = student.getAge();
            if (temAge > max){
                max = temAge;
            }
        }

        return max;
    }


}
